template_format: semantic-kernel
template: |
    [INSTRUCTION]
    Work with user to determine if he or she would like to work on the previous step for one more time.

    [THOUGHT PROCESS]
    [Goal]
    The goal of proposed step.
    [THOUGHT]
    To solve this problem, I should carefully analyze the previous question and response to identify if user is willing to repeat the action again. 
    Any facts I discover earlier in my thought process should be repeated here to keep them readily available.
    [QUESTION]
    If there is any ambiguity in the chat history, ask the follow up question to the user to get clarification on whether the user wants to repeat the previous step.
    The way you will check if the user wants to repeat the step is by asking the question "{{$transitionMessage}}". 
    IMPORTANT: Do NOT update the wording in the question stated above. If you need clarification, you will ask that question word for word.
    If the user says something along the lines of "yes", "sure", "fine", "ok", then they are asking to repeat the step.
    [RESPONSE]
    The result of the action will be provided here. It could be result or error message of the action, or chat history between assistant and user to tackle the problem.
    ... (These THOUGHT/QUESTION/RESPONSE can repeat until the final answer is reached.)
    [FINAL ANSWER]
    Once I have gathered all the necessary observations and can reliably tell if user would like to repeat the step for one more time, output TRUE or FALSE.
    [END THOUGHT PROCESS]

    Example:
    [Goal]
    {{$goal}}
    [QUESTION]
    {{$transitionMessage}}
    [RESPONSE]
    yes
    [THOUGHT]
    Based on the response, the user wants to try the previous step again.
    [FINAL ANSWER]
    TRUE

    IMPORTANT REMINDER: Your each response MUST contain one of [QUESTION] and [FINAL ANSWER]!
    Let's break down the problem step by step and think about the best approach.

    Begin!

    [Goal]
    {{$goal}}
    {{$agentScratchPad}}
    [THOUGHT]    
description: Given the chat history, determine if user would like to execute the previous task for one more time. If not concluded, generate the next message for follow up.
name: CheckRepeatStep
input_variables:
  - name:          goal
    description:   The goal of proposed step
  - name:          transitionMessage
    description:   The transition message
    default:       Do you want to try the previous step again?
  - name:          agentScratchPad
    description:   The agent's scratch pad
execution_settings:
  text-davinci-003:
    temperature:       0.0
    top_p:             1.0
    presence_penalty:  0.0
    frequency_penalty: 0.0
    max_tokens:        400
    stop_sequences:    ["[RESPONSE]"]
  default:  
    temperature:       0.0
    top_p:             1.0
    presence_penalty:  0.0
    frequency_penalty: 0.0
    max_tokens:        400
    stop_sequences:    ["[RESPONSE]"]
